package isanfeng.tuxiaoer.pattern.creational.Esingleton.hungry;

/**
 * 序列化,直接调用类本身的范围; 反射直接报错.
 * jad: 在static里面加载了
 * @author 李红辉
 * @version 1.0
 * @date 2019/10/9 17:15
 */
public enum EnumInstance {
    INSTANCE {
        @Override
        protected void printTest() {
            System.out.println("hi hello");
        }
    };

    protected abstract void printTest();
    private Object data;

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static EnumInstance getInstance() {
        return INSTANCE;
    }
}
